from django.db import models

# Create your models here.


class Book(models.Model):
    name = models.CharField(max_length=20)
    pub_date = models.DateField()
    read = models.IntegerField(default=0)
    comment = models.IntegerField(default=0)
    isDelete = models.BooleanField(default=False)

    class Meta:
        db_table = 'book'


class Character(models.Model):
    name = models.CharField(max_length=20)
    # True 女 False 男
    gender = models.BooleanField(default=False)
    comment = models.CharField(max_length=128)
    book = models.ForeignKey(Book, on_delete=models.CASCADE)

    class Meta:
        db_table = 'character'
